home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / Notification.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  2.7 KB  |  118 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        Notification.h
  3.  
  4.      Contains:    Notification Manager interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __NOTIFICATION__
  21. #define __NOTIFICATION__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __OSUTILS__
  30. #include <OSUtils.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <Memory.h>                                            */
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=mac68k
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT_SUPPORTED
  44. #pragma import on
  45. #endif
  46.  
  47. typedef struct NMRec NMRec, *NMRecPtr;
  48.  
  49. typedef pascal void (*NMProcPtr)(NMRecPtr nmReqPtr);
  50.  
  51. #if GENERATINGCFM
  52. typedef UniversalProcPtr NMUPP;
  53. #else
  54. typedef NMProcPtr NMUPP;
  55. #endif
  56.  
  57. struct NMRec {
  58.     QElemPtr                        qLink;                        /* next queue entry*/
  59.     short                            qType;                        /* queue type -- ORD(nmType) = 8*/
  60.     short                            nmFlags;                    /* reserved*/
  61.     long                            nmPrivate;                    /* reserved*/
  62.     short                            nmReserved;                    /* reserved*/
  63.     short                            nmMark;                        /* item to mark in Apple menu*/
  64.     Handle                            nmIcon;                        /* handle to small icon*/
  65.     Handle                            nmSound;                    /* handle to sound record*/
  66.     StringPtr                        nmStr;                        /* string to appear in alert*/
  67.     NMUPP                            nmResp;                        /* pointer to response routine*/
  68.     long                            nmRefCon;                    /* for application use*/
  69. };
  70. enum {
  71.     uppNMProcInfo = kPascalStackBased
  72.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(NMRecPtr)))
  73. };
  74.  
  75. #if GENERATINGCFM
  76. #define CallNMProc(userRoutine, nmReqPtr)        \
  77.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppNMProcInfo, (nmReqPtr))
  78. #else
  79. #define CallNMProc(userRoutine, nmReqPtr)        \
  80.         (*(userRoutine))((nmReqPtr))
  81. #endif
  82.  
  83. #if GENERATINGCFM
  84. #define NewNMProc(userRoutine)        \
  85.         (NMUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNMProcInfo, GetCurrentArchitecture())
  86. #else
  87. #define NewNMProc(userRoutine)        \
  88.         ((NMUPP) (userRoutine))
  89. #endif
  90.  
  91.  
  92. #if !GENERATINGCFM
  93. #pragma parameter __D0 NMInstall(__A0)
  94. #endif
  95. extern pascal OSErr NMInstall(NMRecPtr nmReqPtr)
  96.  ONEWORDINLINE(0xA05E);
  97.  
  98. #if !GENERATINGCFM
  99. #pragma parameter __D0 NMRemove(__A0)
  100. #endif
  101. extern pascal OSErr NMRemove(NMRecPtr nmReqPtr)
  102.  ONEWORDINLINE(0xA05F);
  103. /* ------------------ */
  104.  
  105. #if PRAGMA_IMPORT_SUPPORTED
  106. #pragma import off
  107. #endif
  108.  
  109. #if PRAGMA_ALIGN_SUPPORTED
  110. #pragma options align=reset
  111. #endif
  112.  
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116.  
  117. #endif /* __NOTIFICATION__ */
  118.